﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace _443_Server
{
	public class Utility
	{
		private static char[] VALID_CHARS = {
        	' ', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i',
        	'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's',
      		't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2',
        	'3', '4', '5', '6', '7', '8', '9'
		};

		public static string LongToString(long l)
		{
			if (l <= 0L || l >= 0x5b5b57f8a98a5dd1L || l % 37L == 0L)
				return "Invalid Name";
			int i = 0;
			char[] ac = new char[12];
			while (l != 0L && i < 12)
			{
				long l1 = l;
				l /= 37L;
				ac[11 - i++] = VALID_CHARS[(int)(l1 - l * 37L)];
			}
			return new String(ac, 12 - i, i);
		}
	}
}
